package com.blog.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.blog.service.IBlogService;
import com.blog.vo.MBlogVo;
import com.github.pagehelper.PageInfo;

@Controller
@RequestMapping("/")
public class QueryController {
	
	@Autowired
	private IBlogService blogService;
	
	@RequestMapping("/customer_list")
	public String customer_list(Model model ,String title, @RequestParam(value="pageNum",defaultValue="1")Integer pageNum,@RequestParam(value="pageSize",defaultValue="10")Integer pageSize){
		
//		List<MBlogVo> lists = blogService.selectByName(title);
		
		PageInfo info = blogService.selectByName2(title, pageNum, pageSize);
		model.addAttribute("pageInfo", info);
		return "blog/list";
		
	}
	

}
